import request from '@/utils/request'

// 查询安全检查任务列表
export function listTask(query) {
  return request({
    url: '/labsafety/task/list',
    method: 'get',
    params: query
  })
}
export function listImmediatelyCheck() {
  return request({
    url: '/labsafety/task/immediatelyCheck',
    method: 'get'
  })
}
export function generalCheckTask(data) {
  return request({
    url: '/labsafety/task/immediatelyCheck',
    method: 'post',
    data: data
  })
}

// 查询安全检查任务详细
export function getTask(instanceId) {
  return request({
    url: '/labsafety/task/' + instanceId,
    method: 'get'
  })
}

// 新增安全检查任务
export function addTask(data) {
  return request({
    url: '/labsafety/task',
    method: 'post',
    data: data
  })
}

// 修改安全检查任务
export function updateTask(data) {
  return request({
    url: '/labsafety/task',
    method: 'put',
    data: data
  })
}

export function submitTask(data) {
  return request({
    url: '/labsafety/task/submit',
    method: 'post',
    data: data
  })
}

// 删除安全检查任务
export function delTask(instanceId) {
  return request({
    url: '/labsafety/task/' + instanceId,
    method: 'delete'
  })
}

// 导出安全检查任务
export function exportTask(query) {
  return request({
    url: '/labsafety/task/export',
    method: 'get',
    params: query
  })
}

// 修改安全检查任务
export function signTask(instanceId) {
  return request({
    url: '/labsafety/task/sign/' + instanceId,
    method: 'put'
  })
}
